import { generateColors } from '@/utils/theme'
import { getSessionInfo } from '@/utils/storage'
import { MAIN_COLOR } from '@/constants'
const getters = {
  sidebar: state => state.app.sidebar,
  device: state => state.app.device,
  headerFixed: state => state.app.headerFixed,
  language: state => state.app.language,
  windowScale: state => state.app.windowScale,
  userInfo: state => state.user.userInfo,
  cssVar: state => {
    return {
      ...state.theme.variables,
      ...generateColors(getSessionInfo(MAIN_COLOR))
    }
  },
  mainColor: state => state.theme.mainColor,
  token: state => state.user.token,
  menuList: state => state.user.menuList,
  permissionCodeList: state => state.user.permissionCodeList,
  tagsViewList: state => state['tag-view'].tagsViewList
}

export default getters
